﻿using ControllerLayer;
using DataAccessObjectLayer;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using ModelLayer;

namespace UnitTest
{
    [TestClass]
    public class UnitTestRoute
    {
        private RouteCtr _routeCtr;
        private readonly long _id;

        /// <summary>
        /// Initializes a new instance of the <see cref="UnitTestRoute"/> class.
        /// </summary>
        public UnitTestRoute()
        {
            _id = GetMax.GetMaxId("SELECT MAX(id) FROM Route");
        }

        /// <summary>
        /// Gets the route.
        /// </summary>
        [TestMethod]
        public void GetRoute()
        {
            _routeCtr = new RouteCtr();
            Route route = _routeCtr.GetRoute(_id);
            Assert.AreNotEqual(route.Id, -1);
        }
    }
}